<!DOCTYPE html>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>留言反馈添加</title>
    <%@include file="common/head.jsp" %>
    <%@include file="common/loginstate.jsp" %>
    <script type="text/javascript" src="${staticPath}/js/popup.js"></script>
    <script language="JavaScript" src="${staticPath}/js/public.js" type="text/javascript"></script>
    <link href="${staticPath}/qtimages/images/apple-touch-icon.png" rel="apple-touch-icon">
    <link href="${staticPath}/qtimages/lib/font-awesome/css/font-awesome.min.css" rel="stylesheet">
    <link href="${staticPath}/qtimages/lib/animate/animate.min.css" rel="stylesheet">
    <link href="${staticPath}/qtimages/lib/ionicons/css/ionicons.min.css" rel="stylesheet">
    <link href="${staticPath}/qtimages/lib/owlcarousel/assets/owl.carousel.min.css" rel="stylesheet">
    <link href="${staticPath}/qtimages/lib/magnific-popup/magnific-popup.css" rel="stylesheet">
    <link href="${staticPath}/qtimages/lib/ionicons/css/ionicons.min.css" rel="stylesheet">
    <link href="${staticPath}/qtimages/lib/bootstrap/css/bootstrap.min.css" rel="stylesheet">
    <link href="${staticPath}/qtimages/css/style.css" rel="stylesheet">
    <link rel="stylesheet" href="${staticPath}/qtimages/css/custom.css">

    <script type="text/javascript">
        //文件上传
        function upx(id) {
            var pop=new Popup({ contentType:1,isReloadOnClose:false,width:400,height:200});
            pop.setContent("contentUrl","${contextPath}/common/upload/?id="+id);
            pop.setContent("title","文件上传");
            pop.build();
            pop.show();
        }
        // 添加留言反馈
        function liuyanAdd() {
			var biaoti = $("#biaoti").length > 0 ? $('#biaoti').val().trim():null;
			if(("#biaoti").length > 0 && biaoti == "")
			{
				alert("please input:标题");
			    $('#biaoti').focus();
				return false;
			}
			var neirong=$('#neirong').val().trim();
			var tianjiashijian = $("#tianjiashijian").length > 0 ? $('#tianjiashijian').val().trim():null;
			if(("#tianjiashijian").length > 0 && tianjiashijian == "")
			{
				alert("please input:添加时间");
			    $('#tianjiashijian').focus();
				return false;
			}
			var usersid=$('#usersid').val().trim();

            var param = {
				'biaoti':biaoti,
				'neirong':neirong,
				'tianjiashijian':tianjiashijian,
				'usersid':usersid,

            };
            $.ajax({
                type: 'post',
                url: '${basePath}/liuyanAddOrUpdate',
                dataType: "json",
                contentType:"application/json",
                data : JSON.stringify(param),
                success: function (resp) {
                    if (resp.success) {
                        alert("添加成功！");
                        //window.location.href = "${contextPath}/liuyanManaMyQian";
                    } else {
                        alert(resp.message);
                    }
                }
            });
        }
    </script>
</head>

<body>
<%@ include file="qttop.jsp" %>
<%@ include file="bht.jsp" %>
<main id="main">
    <section id="services" class="wow fadeInUp">
        <div class="container">
            <div class="section-header">
                <h2>◇◆ 留言反馈添加 ◆◇</h2>
            </div>
            <div class="row">

                <form  name="formAdd" id="formAdd">
                    <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" bordercolor="#00FFFF"
                           style="border-collapse:collapse" class="newsline">
		<tr>
			<td>
				标题:
			</td>
            <td>
                <input type="text" name="biaoti" id="biaoti" size="70px"/>
            </td>

		</tr>
		<tr>
			<td>
				内容:
			</td>
            <td width="80%" bgcolor="#FFFFFF" align="left">
                <textarea name="neirong" id="neirong" style="width:670px;height:200px;"></textarea>
            </td>

		</tr>
		<tr>
			<td>
				添加时间:
			</td>
            <td>
                <input type="text" name="tianjiashijian" id="tianjiashijian" style="border:1px solid #cccccc;" readonly="readonly" size="25px" value="<%=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date())%>" />
            </td>

		</tr>
		<tr style="display: none;">
			<td width="20%" bgcolor="#FFFFFF" align="right">
				用户:
			</td>
            <td style="display: none">
                <select name="usersid" id="usersid" style="border:solid 1px #000000; color:#666666">
                    <option value="${sessionScope.user.id }">${sessionScope.user.loginname }</option>
                </select>
            </td>

		</tr>

                        <tr>
                            <td>&nbsp;</td>
                            <td>
                                <input type="button" name="Submit" value="提交" onClick="liuyanAdd();"
                                       class="content-form-signup"/>
                                <input type="button" value="返回" onClick="javascript:history.back()"/>
                                <%--<input type="reset" name="reset" value="重置" class="content-form-signup"/>--%>
                            </td>
                        </tr>
                    </table>
                </form>

            </div>
        </div>
    </section>
    <%@ include file="qtdown.jsp" %>
</main>
</body>
</html>

